<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    const reactive = target => {
    return new Proxy(target,{
        get(target,key,receiver) {
            const res = Reflect.get(target,key,receiver)
            console.log("get");
            return res
        },
        set(target,key,receiver) {
            const res = Reflect.set(target,key,receiver)
            console.log("set");
            return res
        }
    })
}
const obj= reactive({ a: 1,b: 2 })
obj.a = 2
</script>